/* SPDX-License-Identifier: GPL-2.0 */

#ifndef __VMALLOC_DEBUGINFO_H
#define __VMALLOC_DEBUGINFO_H

#ifdef CONFIG_EULEROS_DMESG_SHOW_VMALLOC_INFO
#define VMALLOC_INFO_TOP_N 10
#define VMALLOC_INFO_MAX_COUNT 200000
#define NORMAL_VM_AREA		0
#define VM_MAP_RAM		1

struct vmallocinfo_node {
	struct rb_node rb_node;

	const void *caller;
	unsigned long size;
	unsigned int type;
};

void vmallocinfo_show(void);
void vmalloc_oom_notify_fault(void);
void lock_vmap_area(void);
void unlock_vmap_area(void);
#else
static inline void vmallocinfo_show(void) {}
static inline void vmalloc_oom_notify_fault(void) {}
#endif

#endif
